package mo.tags.stack;

import java.util.Arrays;

public class L1111 {

    public int[] maxDepthAfterSplit(String seq) {
        int d = 0;
        int length = seq.length();
        int[] ans = new int[length];
        for (int i = 0; i < length; i++) {
            if (seq.charAt(i) == '(') {
                ++d;
                ans[i] = d % 2;
            } else {
                ans[i] = d % 2;
                --d;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        L1111 test = new L1111();
        int[] ints = test.maxDepthAfterSplit("((()))");
        System.out.println(Arrays.toString(ints));
    }

}
